package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.HygieneMapper;
import com.youlai.boot.system.model.QB.Hygiene;
import com.youlai.boot.system.service.HygieneService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class HygieneServiceImpl extends ServiceImpl<HygieneMapper, Hygiene> implements HygieneService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private HygieneMapper hygieneMapper;
    @Override
    public boolean saveHygiene(Hygiene hygiene) {

        hygiene.setAddtime(LocalDateTime.now());
        return save(hygiene);
    }

    @Override
    public List<Hygiene> getAllHygiene() {
        return hygieneMapper.selectList(null);
    }

    @Override
    public boolean deletHygieneById(Integer id) {
        return baseMapper.deleteById(id)>0;
    }
}
